package com.huabo.monitor.oracle.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hbfk.util.PageInfo;
import com.huabo.monitor.oracle.entity.TblAssesstemple;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.math.BigDecimal;
import java.util.List;

public interface TblAssesstempleMapper extends BaseMapper<TblAssesstemple> {

    @SelectProvider(type = TblAssesstempleMapperSqlConfig.class, method = "findByPageInfo")
    List<TblAssesstemple> findByPageInfo(PageInfo<TblAssesstemple> pageInfo);

    @SelectProvider(type = TblAssesstempleMapperSqlConfig.class, method = "findByCount")
    Integer findByCount(PageInfo<TblAssesstemple> pageInfo);

    @Select("select * from TBL_ASSESSTEMPLE where ASSTEMID = #{tmplId}")
    TblAssesstemple findById(@Param("tmplId") BigDecimal tmplId);

    @Delete("delete from TBL_ASSESSTEMPLE where  ASSTEMID = #{tmplId}")
    void deleteId(@Param("tmplId")BigDecimal asstemid);

    @Select("select * from TBL_ASSESSTEMPLE t where t.TEMPLENUMBER = #{templeNumber} AND t.ORGID =#{orgid}")
    List<TblAssesstemple> getTmplByNumber(@Param("templeNumber")String templeNumber,@Param("orgid") BigDecimal orgid);

    void updateByPrimaryKey(TblAssesstemple tblAssesstemple);
}
